<html xmlns="http://www.w3.org/1999/xhtml"><head><style type="text/css">
dt {
  font-style: italic;
  margin-top: 15px;
  margin-bottom: 3px;
  margin-left: 0px;
  border-bottom: 1px dotted black;
}
dd {
  margin-left: 10px;
}
table {
  border-collapse:collapse;
  border: 1px solid black;
  margin-top: 7px;
}
th {
  border: 1px solid black;
  padding: 3 7 3 7;
}
td {
  border: 1px solid black;
  padding: 3 7 3 7;
}
</style></head><body><p><a name="i2s"></a><b>i2s</b> :
  convert integer to short integer : <a href="opcodes.html">index</a> : <a href="http://asm.objectweb.org/asm40/javadoc/user/org/objectweb/asm/MethodVisitor.html#visitInsn(int)">visitInsn()</a></p><dl><dt>Description</dt><dd>Converts an integer to a signed short.  A 32-bit int is popped off the
stack, the top 16 bits are set to zero, and the resulting value is then sign
extended to an int.  The int result is pushed back onto the stack. <br></br>i2s is used in Java where there is an explicit case between an int and a short.
Notice that i2s can cause a change in sign. For example, in the code:<br></br><pre>
    int x = -40000;
    short s = (short)x;
</pre>
The
value of s is positive 25536, since the sign bit of x is lost in the
conversion.</dd><dt>See also</dt><dd><a href="ref-i2b.html">i2b</a> <a href="ref-.html"></a> <a href="ref-i2c.html">i2c</a> </dd><dt>Stack</dt><dd><table xmlns="">
<tr>
<td>
<b>Before </b>
</td>
<td><b>After</b></td></tr>
<tr>
<td>value</td>
<td>result</td></tr>
<tr>
<td>...</td>
<td>...</td></tr>
</table></dd><dt>Bytecode</dt><dd><table xmlns="">
<tr>
<td>
<b> Type </b>
</td>
<td><b>Description</b></td></tr>
<tr>
<td>
u1 
</td>
<td>i2s
opcode = 0x93 (147)
</td></tr>
</table></dd></dl></body></html>